#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>

using namespace std;

const int N = 2e5 + 5;
int n, a[N];

int b[N];
int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];

    bool hasGold = true;

    for (int i = 1; i < n; i++) {
        if (hasGold) {
            if (a[i] > a[i+1]) {
                b[i] = 1;
                hasGold = false;
            }
        } else {
            if (a[i] <= a[i+1]) {
                b[i] = 1;
                hasGold = true;
            }
        }
    }


    if (!hasGold) b[n] = 1;

    for (int i = 1;i <= n; i++) {
        cout << b[i] << ' ';
    }
    cout << endl;
    return 0;
}